/**
 * 
 */
package vue.popup;

import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

/**
 * A simple frame that display information, basically use to show stdout, stderr.
 * 
 * @author GRONOWSKI Stephane svan001@aol.com
 * 
 *         igsat 2010
 * 
 */
public class IGOutFrame extends JFrame {

	public static final int		DEFAULT_WIDTH		= 650;
	public static final int		DEFAULT_HEIGHT		= 500;

	private static final long	serialVersionUID	= 1L;
	private JTextArea			area;

	/**
	 * Create {@link IGOutFrame}.
	 * 
	 * @param title
	 *            title of the frame
	 * @param text
	 *            text o display
	 */
	public IGOutFrame(String title, String text) {
		super(title);
		area = new JTextArea(text);
		area.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
		JPanel panel = new JPanel();
		JScrollPane pane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		setContentPane(pane);


		panel.add(area);

		setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT));
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		pack();
		setVisible(true);
	}

}
